home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’95 / Closure / Sources / PhotoshopHeaders / PIGeneral.r < prev    next >
Encoding:
Text File  |  1995-06-24  |  9.7 KB  |  397 lines  |  [TEXT/MPS ]

  1. /*
  2.     File: PIGeneral.r
  3.  
  4.     Copyright 1991-95 by Adobe Systems Inc. All rights reserved.
  5.  
  6. */
  7.  
  8. #ifndef __PIGeneral.r__
  9. #define __PIGeneral.r__
  10.  
  11. #ifndef kPIPropertiesVersion
  12. #define kPIPropertiesVersion 0
  13. #endif
  14.  
  15. type 'PiPL'
  16.     {
  17.     longint = kPIPropertiesVersion;
  18.     longint = $$CountOf(properties);
  19.     array properties
  20.         {
  21.         switch
  22.             {
  23.  
  24. /* Properties for all types of plug-ins. */
  25.  
  26.             case Kind:
  27.                 longint = '8BIM';
  28.                 key longint = 'kind';
  29.                 longint = 0;
  30.                 longint = 4;
  31.                 longint Filter = '8BFM', Parser = '8BYM', ImageFormat='8BIF',
  32.                         Extension = '8BXM', Acquire = '8BAM', Export = '8BEM';
  33.  
  34.             case Version:
  35.                 longint = '8BIM';
  36.                 key longint = 'vers';
  37.                 longint = 0;
  38.                 longint = 4;
  39.                 longint;
  40.  
  41.             case Priority:
  42.                 longint = '8BIM';
  43.                 key longint = 'prty';
  44.                 longint = 0;
  45.                 longint = 4;
  46.                 longint;
  47.  
  48.             case RequiredHost:
  49.                 longint = '8BIM';
  50.                 key longint = 'host';
  51.                 longint = 0;
  52.                 longint = 4;
  53.                 longint;
  54.  
  55.             case Name:
  56.                 longint = '8BIM';
  57.                 key longint = 'name';
  58.                 longint = 0;
  59.                 longint = (nameEnd[$$ArrayIndex(properties)] - nameStart[$$ArrayIndex(properties)]) / 8;
  60.               nameStart:
  61.                 pstring;
  62.               nameEnd:
  63.                 align long;
  64.  
  65.             case Category:
  66.                 longint = '8BIM';
  67.                 key longint = 'catg';
  68.                 longint = 0;
  69.                 longint = (catgEnd[$$ArrayIndex(properties)] - catgStart[$$ArrayIndex(properties)]) / 8;
  70.               catgStart:
  71.                 pstring;
  72.               catgEnd:
  73.                 align long;
  74.  
  75.             case Code68k:
  76.                 longint = '8BIM';
  77.                 key longint = 'm68k';
  78.                 longint = 0;
  79.                 longint = 6;
  80.                 longint;
  81.                 integer;
  82.                 align long;
  83.  
  84.             case CodePowerPC:
  85.                 longint = '8BIM';
  86.                 key longint = 'pwpc';
  87.                 longint = 0;
  88.                 longint = (pwpcEnd[$$ArrayIndex(properties)] - pwpcStart[$$ArrayIndex(properties)]) / 8;
  89.               pwpcStart:
  90.                 longint;
  91.                 longint;
  92.                 pstring;
  93.               pwpcEnd:
  94.                 align long;
  95.  
  96.             case SupportedModes:
  97.                 longint = '8BIM';
  98.                 key longint = 'mode';
  99.                 longint = 0;
  100.                 longint = (modeEnd[$$ArrayIndex(properties)] - modeStart[$$ArrayIndex(properties)]) / 8;
  101.               modeStart:
  102.                 wide array modeData { byte; };
  103.               modeEnd:
  104.                 align long;
  105.  
  106. /* Filter plug-in properties. */
  107.  
  108.             case FilterCaseInfo:
  109.                 longint = '8BIM';
  110.                 key longint = 'fici';
  111.                 longint = 0;
  112.                 longint = 28;
  113.                 array [7]
  114.                     {
  115.                     byte inCantFilter = 0,
  116.                          inStraightData = 1,
  117.                          inBlackMat = 2,
  118.                          inGrayMat = 3,
  119.                          inWhiteMat = 4,
  120.                          inDefringe = 5,
  121.                          inBlackZap = 6,
  122.                          inGrayZap = 7,
  123.                          inWhiteZap = 8,
  124.                          inBackgroundZap = 10,
  125.                          inForegroundZap = 11;
  126.                     byte outCantFilter = 0,
  127.                          outStraightData = 1,
  128.                          outBlackMat = 2,
  129.                          outGrayMat = 3,
  130.                          outWhiteMat = 4,
  131.                          outFillMask = 9;
  132.                     fill bit [5];
  133.                     boolean doesNotFilterLayerMasks, filtersLayerMasks;
  134.                     boolean doesNotWorkWithBlankData, worksWithBlankData;
  135.                     boolean copySourceToDestination, doNotCopySourceToDestination;
  136.                     fill byte;
  137.                     } ;
  138.  
  139. /* Format plug-in properties. */
  140.  
  141.             case FmtFileType:
  142.                 longint = '8BIM';
  143.                 key longint = 'fmTC';
  144.                 longint = 0;
  145.                 longint = 8;
  146.                 longint; /* Default file type. */
  147.                 longint; /* Default file creator. */
  148.  
  149.             case ReadTypes:
  150.                 longint = '8BIM';
  151.                 key longint = 'RdTy';
  152.                 longint = 0;
  153.                 longint = $$CountOf(ReadableTypes) * 8;
  154.                 wide array ReadableTypes {longint; longint; } ;
  155.  
  156.             case WriteTypes:
  157.                 longint = '8BIM';
  158.                 key longint = 'WrTy';
  159.                 longint = 0;
  160.                 longint = $$CountOf(WritableTypes) * 8;
  161.                 wide array WritableTypes {longint; longint; } ;
  162.  
  163.             case FilteredTypes:
  164.                 longint = '8BIM';
  165.                 key longint = 'fftT';
  166.                 longint = 0;
  167.                 longint = $$CountOf(FilteredTypes) * 8;
  168.                 wide array FilteredTypes {longint; longint; } ;
  169.  
  170.             case ReadExtensions:
  171.                 longint = '8BIM';
  172.                 key longint = 'rdEx';
  173.                 longint = 0;
  174.                 longint = $$CountOf(ReadableExtensions) * 4;
  175.                 wide array ReadableExtensions { longint; } ;
  176.  
  177.             case WriteExtensions:
  178.                 longint = '8BIM';
  179.                 key longint = 'wrEx';
  180.                 longint = 0;
  181.                 longint = $$CountOf(WriteableExtensions) * 4;
  182.                 wide array WriteableExtensions { longint; } ;
  183.  
  184.             case FilteredExtensions:
  185.                 longint = '8BIM';
  186.                 key longint = 'fftE';
  187.                 longint = 0;
  188.                 longint = $$CountOf(FilteredExtensions) * 4;
  189.                 wide array FilteredExtensions {longint; } ;
  190.  
  191.             case FormatFlags:
  192.                 longint = '8BIM';
  193.                 key longint = 'fmtf';
  194.                 longint = 0;
  195.                 longint = (fmtFlagsEnd[$$ArrayIndex(properties)] - fmtFlagsStart[$$ArrayIndex(properties)]) / 8;
  196.               fmtFlagsStart:
  197.                 wide array fmtFlagsData { byte; };
  198.               fmtFlagsEnd:
  199.                 align long;
  200.  
  201.             case FormatMaxSize:
  202.                 longint = '8BIM';
  203.                 key longint = 'mxsz';
  204.                 longint = 0;
  205.                 longint = 4;
  206.                 Point;
  207.  
  208.             case FormatMaxChannels:
  209.                 longint = '8BIM';
  210.                 key longint = 'mxch';
  211.                 longint = 0;
  212.                 longint = $$CountOf(ChannelsSupported) * 2;
  213.                 wide array ChannelsSupported { integer; } ;
  214.                 align long;
  215.  
  216. /* Parser Properties. */
  217.  
  218.             case ParsableTypes:
  219.                 longint = '8BIM';
  220.                 key longint = 'psTY';
  221.                 longint = 0;
  222.                 longint = $$CountOf(ParsableTypes) * 8;
  223.                 wide array ParsableTypes {longint; longint; } ;
  224.  
  225.             case ParsableExtensions:
  226.                 longint = '8BIM';
  227.                 key longint = 'psEX';
  228.                 longint = 0;
  229.                 longint = $$CountOf(ParsableExtensions) * 4;
  230.                 wide array ParsableExtensions { longint; };
  231.  
  232.             case FilteredParsableTypes:
  233.                 longint = '8BIM';
  234.                 key longint = 'psTy';
  235.                 longint = 0;
  236.                 longint = $$CountOf(ParsableTypes) * 8;
  237.                 wide array ParsableTypes {longint; longint; } ;
  238.  
  239.             case FilteredParsableExtensions:
  240.                 longint = '8BIM';
  241.                 key longint = 'psEx';
  242.                 longint = 0;
  243.                 longint = $$CountOf(ParsableExtensions) * 4;
  244.                 wide array ParsableExtensions { longint; };
  245.  
  246.             case ParsableClipboardTypes:
  247.                 longint = '8BIM';
  248.                 key longint = 'psCB';
  249.                 longint = 0;
  250.                 longint = $$CountOf(ParsableClipboardTypes) * 4;
  251.                 wide array ParsableClipboardTypes { longint; };
  252.  
  253.             };
  254.         };
  255.     };
  256.  
  257. /********************************************************************************/
  258.  
  259. #ifndef PiMIVersion
  260. #define PiMIVersion 0
  261. #endif
  262.  
  263. type 'PiMI'
  264. {
  265. Start:                /* The following is common to all Photoshop 2.5 Plugin modules      */
  266.     integer;                        /* The version number of the interface supported. */
  267.     integer;                        /* The sub-version number.                          */
  268.     integer;                        /* The plug-in's priority.                        */
  269.     integer = (General-Start)/8;    /* The size of the general info.                  */
  270.     integer = (TypeInfo-General)/8;    /* The size of the type specific info.              */
  271.     integer;                        /* A bit mask indicating supported image modes.   */
  272.     literal longint;                /* A required host if any.                          */
  273. General:
  274.  
  275.     array {            /* The following is used only for Format Plugin modules              */
  276.         integer = $$Countof(TypeArray);                /* type count */
  277.         integer = $$Countof(ExtensionArray);        /* extension count */
  278.         byte  cannotRead, canRead;                    /* Can we read using this format?                  */
  279.         byte  cannotReadAll, canReadAll;            /* Can this plug-in read from all files?          */
  280.         byte  cannotWrite, canWrite;                /* Can we write using this format?                  */
  281.         byte  cannotWriteIfRead, canWriteIfRead;    /* Can we write if we read using this format?      */
  282.         byte  doesntSaveResources, savesResources;    /* Does this file format save the resource data?  */
  283.         #if PiMIVersion > 0
  284.         byte  doesntSupportsFilterCalls, supportsFilterCalls; /* Supports filter calls for formats. */
  285.         #else
  286.         fill byte;                    /* Padding */
  287.         #endif
  288.         wide array [16]
  289.             { integer; };            /* Maximum # of channels with each plug-in mode.  */
  290.         integer;                    /* Maximum rows allowed in document.              */
  291.         integer;                    /* Maximum columns allowed in document.              */
  292.         literal longint;            /* The file type if we create a file.              */
  293.         literal longint;            /* The creator type if we create a file.          */
  294.         array TypeArray
  295.         {
  296.             literal longint;        /* The type-creator pairs supported.              */
  297.             literal longint;
  298.         };
  299.         array ExtensionArray
  300.         {
  301.             literal longint;        /* The extensions supported.                      */
  302.         };
  303.     };
  304.     
  305.     array {        /* The following is used only for filter plug-in modules.              */
  306.         byte    dontCopySourceToDestination, copySourceToDestination;
  307.     };
  308. TypeInfo:
  309. };
  310.     
  311. #define supportsBitmap             1
  312. #define supportsGrayScale        2
  313. #define supportsIndexedColor    4
  314. #define supportsRGBColor        8
  315. #define supportsCMYKColor       16
  316. #define supportsHSLColor       32
  317. #define supportsHSBColor       64
  318. #define supportsMultichannel  128
  319. #define supportsDuotone          256
  320. #define supportsLABColor      512
  321.  
  322. #define flagSupportsBitmap          128
  323. #define flagSupportsGrayScale      64
  324. #define flagSupportsIndexedColor  32
  325. #define flagSupportsRGBColor      16
  326. #define flagSupportsCMYKColor       8
  327. #define flagSupportsHSLColor       4
  328. #define flagSupportsHSBColor       2
  329. #define flagSupportsMultichannel   1
  330. #define flagSupportsDuotone         128
  331. #define flagSupportsLABColor      64
  332.  
  333. #define latestAcquireVersion        4
  334. #define latestAcquireSubVersion        0
  335. #define latestExportVersion            4
  336. #define latestExportSubVersion        0
  337. #define latestExtensionVersion        1
  338. #define latestExtensionSubVersion    0
  339. #define latestFilterVersion            4
  340. #define latestFilterSubVersion        0
  341. #define latestFormatVersion            1
  342. #define latestFormatSubVersion        0
  343. #define latestParserVersion            1
  344. #define latestParserSubVersion        0
  345.  
  346.  
  347. #if 0
  348.  
  349. /* Example of Format plugin resource */
  350.  
  351. resource 'PiMI' (16000, purgeable)
  352. {
  353.     latestFormatVersion,     /* Version, subVersion, and priority of the interface */
  354.     latestFormatSubVersion,
  355.     0,
  356.     supportsGrayScale+supportsRGBColor+supportsCMYKColor,
  357.     '8BIM',
  358.     
  359.     {
  360.         canRead,
  361.         cannotReadAll,
  362.         canWrite,
  363.         canWriteIfRead,
  364.         doesntSaveResources,
  365.         { 0, 1, 0, 3,
  366.           4, 0, 0, 0,
  367.           0, 0, 0, 0,
  368.           0, 0, 0, 0 },
  369.         32767,
  370.         32767,
  371.         'JPEG',
  372.         '8BIM',
  373.         {
  374.             'JPEG', '8BIM'
  375.         },
  376.         {
  377.             'JPG '
  378.         }
  379.     }
  380. };
  381.  
  382. /* Example of Acquire/Export resource */
  383.  
  384. resource 'PiMI' (16001, purgeable)
  385. {
  386.     latestAcquireVersion,     /* Version, subVersion, and priority of the interface */ 
  387.     latestAcquireSubVersion, 
  388.     0,
  389.     supportsGrayScale+supportsRGBColor+supportsCMYKColor,
  390.     '8BIM',
  391.     {}            /* Null Format extension field */
  392. };
  393.  
  394. #endif
  395.  
  396. #endif
  397.